<%--
  Created by IntelliJ IDEA.
  User: 自由如风
  Date: 2018/10/21
  Time: 15:51
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<!--[if IE 8]><html class="ie8" lang="en"><![endif]-->
<!--[if IE 9]><html class="ie9" lang="en"><![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- start: HEAD -->
<head>
    <title>子项目页面</title>
    <!-- start: META -->
    <meta charset="utf-8"/>
    <!--[if IE]>
    <meta http-equiv='X-UA-Compatible' content="IE=edge,IE=9,IE=8,chrome=1"/><![endif]-->
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta content="" name="description"/>
    <meta content="" name="author"/>
    <meta name="renderer" content="webkit"/>
    <!-- end: META -->
    <link rel="shortcut icon" type="image/x-icon" href="${pageContext.request.contextPath}/resources/images/favicon.ico"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/fonts-useso/fonts.css">

    <!-- bootstrap 及 bootstrap拓展 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/bootstrap-3.3.5-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/bootstrap-3.3.5-dist/css/bootstrap-expand.css">
    <!-- end: 主要css -->
    <!-- start: 插件 css -->

    <!-- bootstrap 摸态框 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/bootstrap-modal/css/bootstrap-modal.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css">
    <!-- 单选/多选 插件 -->

    <!-- iCheck 多选/单选插件  -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/iCheck/skins/all.css">
    <!-- 滚动条 -->

    <!-- perfect-scrollbar 自定义滚动条  -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/perfect-scrollbar/src/perfect-scrollbar.css">
    <!-- font-awesome -->

    <!-- Font Awesome 图标字体  -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/font-awesome/css/font-awesome.min.css">
    <!-- css3动画 -->

    <!-- animate css3动画  -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/animate.css/animate.min.css">
    <!-- select2插件 -->

    <!-- animate css3动画  -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/select2-master/dist/css/select2.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/select2-bootstrap/dist/select2-bootstrap.css">
    <!-- 富文本编辑器 -->

    <!-- 富文本编辑器 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/summernote/dist/summernote.css">
    <!-- 图片裁剪 -->

    <!-- cropper 图片剪切 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/cropper-master/dist/cropper.css">
    <!-- 文件上传 -->

    <!-- cropper 文件上传 -->
    <!--[if lt IE 10]>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/uploadify/uploadify.css"/>
    <![endif]-->
    <!--[if gte IE 10]><!-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/uploadifive/uploadifive.css"/>
    <!--<![endif]-->
    <!-- 表单验证 -->

    <!-- 表单验证 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/jQuery-Validation-Engine-master/css/validationEngine.jquery.css">
    <!-- 日期插件 -->

    <!-- 日期插件 -->
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/resources/plugins/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css">
    <!-- ztree 树 -->

    <!-- ztree -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/zTree_v3/css/zTreeStyle/zTreeStyle.css">
    <!-- 弹出框 -->

    <!-- sweetalert 弹出框  -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/sweetalert-0.5.x/lib/sweet-alert.css">
    <!-- 图片预览 -->

    <!-- 图片预览  -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/viewer-master/dist/viewer.css">
    <!-- end: 插件 css -->


    <!-- start: 框架 css -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/styles.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/styles-responsive.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/plugins.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/themes/theme-default.css" type="text/css" id="skin_color">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/print.css" type="text/css" media="print"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/quick-layout.css">
    <!-- end: 框架 css -->
    <!--[if lt IE 9]>
    <script src="${pageContext.request.contextPath}/resources/plugins/respond.min.js"></script>
    <script src="${pageContext.request.contextPath}/resources/plugins/excanvas.min.js"></script>
    <script src="${pageContext.request.contextPath}/resources/plugins/jQuery/jquery-1.11.1.min.js"></script>
    <![endif]-->
    <!--[if gte IE 9]><!-->
    <script src="${pageContext.request.contextPath}/resources/plugins/jQuery/jquery-2.1.1.min.js"></script>
    <!--<![endif]-->
    <script>
        var basePath = '';
        var tabModel = true;
        var nodePath = 'https://www.scxszz.com:443/pros_sczz';
    </script>
</head>

<!-- end: HEAD -->
<!-- start: BODY -->
<body class="single-page">

<div class="tabModel-content animated hide">
    <h3 style="text-align: center;">试题列表</h3>

    <hr class="dividing-line mb10"/>

    <div class="row" id="czBtn">
        <div class="col-md-12">
            <!-- mainlist_type 菜单跳转  1 为在校生  2 为毕业生 -->

            <!-- 默认只有高校能操作数据 -->


            <div class="btn-group pull-right">
                <%-- <button data-toggle="dropdown"
                         class="btn btn-sm btn-green dropdown-toggle page-size">
                     20 <i class="fa fa-angle-down"></i>
                 </button>--%>
                <ul class="dropdown-menu dropdown-light pull-right">
                    <li><a data-page-size="20">20</a></li>
                    <li><a data-page-size="50">50</a></li>
                    <li><a data-page-size="80">80</a></li>
                    <li><a data-page-size="100">100</a></li>
                </ul>
            </div>

        </div>
    </div>

    <div class="dataTables_wrapper form-inline">
        <table
                class="table table-striped table-hover dataTable table-bordered table-align-center"
                style="table-layout: fixed">
            <thead>
            <tr>
                <th class="center w20">
                    <div class="checkbox-table">
                        <label> <input type="checkbox" class="grey selectall">
                        </label>
                    </div>
                </th>
                <th>试题ID</th>
                <th>试题题干</th>
                <th>删除</th>
            </tr>
            </thead>

            <tbody id="teacherInfo">
            <c:forEach items="${optionList}" var="option">
                <tr id="info" class="teacherInfo">

                    <td class="center w20">
                        <div class="checkbox-table">
                            <label> <input type="checkbox" name="selectNode"
                                           class="grey foocheck"
                                           id="2017091258F6A0C768201099E0537D5712ACE6C7"
                                           value="2017091258F6A0C768201099E0537D5712ACE6C7">
                            </label>
                        </div>
                    </td>
                    <td>${option.optionId}</td>
                    <td>${option.optionQuestion}</td>
                    <td><a href="#" onclick="deleteOption(${option.optionId})">删除</a> </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>

    </div>

</div>
</form>
</div>
</div>
</div>
</div>
<!-- end: PAGE CONTENT-->

</div>

<%--更新教师的状态--%>
<script type="text/javascript">

    function updateTeacherStatus(teacherId,workNumber,status) {

        $.ajax({
            type: 'POST',
            url:'${pageContext.request.contextPath}/admin/updateTeacherStatus',
            data: {teacherId:teacherId,status:status,workNumber:workNumber},
            dataType:'json',
            timeout: 50000,

            success: function (result) {
                if(result.error == 0) {
                    alert("操作成功");
                }else {
                    alert("操作失败");
                }
            },

            error: function (xhr, type) {
                alert('请求出错');
            }
        });

    }

    function  deleteOption(optionId) {
        $.ajax({
            type: 'POST',
            url:'${pageContext.request.contextPath}/admin/deleteAOption',
            data: {optionId:optionId},
            dataType:'json',
            timeout: 50000,

            success: function (result) {
                if(result.error == 0) {
                    alert("操作成功");
                    location.reload(true);
                }else {
                    alert("操作失败");
                }
            },

            error: function (xhr, type) {
                alert('请求出错');
            }
        });
    }
</script>

<script type="text/javascript">
    <%--删除试卷弹出提示框--%>
    var message;
    function deleteTeacher() {
        message = window.confirm("确认删除？")
        return message;
    }


</script>

<!-- start: 必要脚本 -->


<!-- jquery-ui -->
<script src="${pageContext.request.contextPath}/resources/plugins/jquery-ui-1.11.4/jquery-ui.min.js"></script>

<!-- jquery-ui -->
<script src="${pageContext.request.contextPath}/resources/plugins/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>

<!-- blockUI -->
<script src="${pageContext.request.contextPath}/resources/plugins/blockUI/jquery.blockUI.js"></script>

<!-- radio,checkbox -->

<!-- 单选/多选 插件 -->
<script src="${pageContext.request.contextPath}/resources/plugins/iCheck/jquery.icheck.min.js"></script>
<!-- 下拉插件 -->

<!-- 下拉插件 -->
<script src="${pageContext.request.contextPath}/resources/plugins/select2-master/dist/js/select2.min.js"></script>
<!-- end: 必要脚本 -->
<!-- moment -->

<!-- 时间工具 -->
<script src="${pageContext.request.contextPath}/resources/plugins/moment/min/moment.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/moment/locale/zh-cn.js"></script>
<!-- jquery.cookie -->

<!-- jquery.cookie -->
<script src="${pageContext.request.contextPath}/resources/plugins/jquery-cookie/jquery.cookie.js"></script>
<!-- 滚动条 -->

<!-- 滚动条 -->
<script src="${pageContext.request.contextPath}/resources/plugins/perfect-scrollbar/src/jquery.mousewheel.js"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/perfect-scrollbar/src/perfect-scrollbar.js"></script>
<!-- 图片裁剪 -->

<!-- 图片剪裁 -->
<script src="${pageContext.request.contextPath}/resources/plugins/cropper-master/dist/cropper.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/croppre.js"></script>
<!-- 文件上传 -->

<!-- 文件上传 -->
<!--[if lt IE 10]>
<script src="${pageContext.request.contextPath}/resources/plugins/uploadify/jquery.uploadify.min.js"></script>
<![endif]-->
<!--[if gte IE 10]><!-->
<script src="${pageContext.request.contextPath}/resources/plugins/uploadifive/jquery.uploadifive.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/content-type.js"></script>
<!--<![endif]-->
<!-- 表单验证 -->

<!-- 表单验证 -->
<script src="${pageContext.request.contextPath}/resources/plugins/jQuery-Validation-Engine-master/js/jquery.validationEngine.js"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/jQuery-Validation-Engine-master/js/languages/jquery.validationEngine-zh_CN.js"></script>
<!-- 日期插件 -->

<!-- 日期插件 -->
<script src="${pageContext.request.contextPath}/resources/plugins/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<!-- ztree -->

<!-- ztree -->
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/plugins/zTree_v3/js/jquery.ztree.all-3.5.min.js"></script>
<!-- 提示框 -->

<!-- 提示框 -->
<script src="${pageContext.request.contextPath}/resources/plugins/bootbox/bootbox.min.js"></script>
<!-- 弹出框 -->

<!-- 弹出框 -->
<script src="${pageContext.request.contextPath}/resources/plugins/sweetalert-0.5.x/lib/sweet-alert.js"></script>
<!-- 自动大小 -->

<script src="${pageContext.request.contextPath}/resources/plugins/autosize/jquery.autosize.min.js"></script>
<!-- 文字截取 -->

<!-- 文字截取 -->
<script src="${pageContext.request.contextPath}/resources/plugins/truncate/jquery.truncate.js"></script>
<!-- 富文本编辑器 -->

<!-- 富文本编辑器 -->
<script src="${pageContext.request.contextPath}/resources/plugins/ueditor/ueditor.config.js"></script>
<script src="${pageContext.request.contextPath}/resources/plugins/ueditor/ueditor.all.min.js"></script>
<!-- 向导式表单 -->

<!-- 向导式表单 -->
<script src="${pageContext.request.contextPath}/resources/plugins/jQuery-Smart-Wizard/js/jquery.smartWizard.js"></script>
<!-- 图片预览 -->

<!-- 图片预览  -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/plugins/viewer-master/dist/viewer.css">
<!-- 框架 -->


<!-- start: CORE JAVASCRIPTS -->
<script src="${pageContext.request.contextPath}/resources/js/syscode_init.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/syscode.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/main.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/frame-tool-tab-model.js"></script>
<!-- end: CORE JAVASCRIPTS -->
<script>
    tool.userloginid = 'chengongsuo';
    tool.usertype = '1, 2, 3, 4, 5';
    tool.group = '15122910383306910022,';
    $(document).ready(function () {
        $('.form-horizontal').each(function () {
            var $form = $(this);
            if (isBlank($form.attr('data-action'))) {
                $form.attr('data-action', window.location.href);
                if (window.location.href.indexOf("action") < 0) {//spring mvc
                    $form.find("#yspager_currentPageno").attr("name", "currentPageno");
                    $form.find("#eachPageRows").attr("name", "eachPageRows");
                }
            }
        });
        $('.tabModel-content').removeClass('hide').addClass("fadeInUp").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
            $(this).removeClass("fadeInUp");
        });
        Main.initTabModel();
    });
</script>
<!-- 图标 -->

<!-- 图表 -->
<script src="${pageContext.request.contextPath}/resources/plugins/Highcharts-4.2.6/js/highcharts.js"></script>

</body>

</html>


<script type="text/javascript">
    $(function () {
        $(".yc").hide();
        $(".butyc").hide();
    });
    page = {

        text: $("#czBtn").html(),
        exportData: function (el, param, num) {
            var form_element = $(el).parents('.form-horizontal');
            var ids = tool.getChoseData(form_element);
            var elList = form_element.find('input[type="text"],input[type="hidden"],select');
            var temp = "";
            elList.each(function () {
                var $el = $(this);
                if (isNotBlank($el.val())) {
                    temp += $el.attr('name') + '=' + $el.val() + '&';
                }
            });
            if (elList.length > 0) {
                temp = temp.substr(0, temp.length - 1);
            }
            param = param + '?' + temp + '&mainlist_type=' + '1';
            if (num == '2') {
                var url = 'https://www.scxszz.com:443/pros_sczz/s/biz/gxXsxx/checkDepart';
                $.post(tool.initParams(url), {}, function (data) {
                    var d = eval('(' + data + ')');
                    if (d.oper_res != 'success') {
                        $("#reason").click();
                        //tool.alertWarning("警告","本校没有导入全国模板，请先在“在校生信息管理”中导入学生信息全国模板。");
                        //return;
                    } else {
                        if (isBlank(ids)) {
                            tool.alertConfirm('确定要导出所有数据吗?', '', function () {
                                tool.exportData(param, 'https://www.scxszz.com:443/pros_sczz');
                            })
                        } else {
                            param = param + "&wid=" + ids;
                            tool.exportData(param, 'https://www.scxszz.com:443/pros_sczz');
                        }
                    }
                });
            } else if (num == '1') {
                if (isBlank(ids)) {
                    tool.alertConfirm('确定要导出所有数据吗?', '', function () {
                        tool.exportData(param, 'https://www.scxszz.com:443/pros_sczz');
                    })
                } else {
                    param = param + "&wid=" + ids;
                    tool.exportData(param, 'https://www.scxszz.com:443/pros_sczz');
                }
            }

        },
        removeAll: function (el) {
            tool.alertConfirm('确定要清除所有学生信息吗?', '清除后将无法恢复，请一定要谨慎操作！', function () {
                var url = 'https://www.scxszz.com:443/pros_sczz/s/biz/gxXsxx/removeAll';
                $.post(tool.initParams(url), {}, function (data) {
                    var d = eval('(' + data + ')');
                    setTimeout('tool.alertWarning("' + d.oper_msg + '")', 100);
                    tool.doSearch(el);
                });
            })
        },
        resetData: function (el) {
            var ids = tool.getChoseData($(el).parents('.form-horizontal'));
            if (ids != null && ids != '') {
                $.post(tool.initParams('https://www.scxszz.com:443/pros_sczz/s/biz/gxXsxx/resetpwd'), {'wid': ids}, function (data) {
                    if (data.oper_res == true) {
                        tool.alertSuccess(data.oper_msg);
                    } else {
                        tool.alertWarning(data.oper_msg);
                    }
                });
            } else {
                tool.alertWarning("请勾选要重置密码的学生!");
            }
        },
        updateByzt: function (el, byzt) {
            var ids = tool.getChoseData($(el).parents('.form-horizontal'));
            if (ids != null && ids != '') {
                $.post(tool.initParams('https://www.scxszz.com:443/pros_sczz/s/biz/gxXsxx/updateByzt'), {
                    'wid': ids,
                    'byzt': byzt
                }, function (data) {
                    var d = eval('(' + data + ')');
                    if (d.oper_res == true) {
                        setTimeout('tool.alertSuccess(" 操作成功！")', 100);
                        tool.doSearch(el);
                    } else {
                        tool.alertWarning(d.oper_msg);
                    }
                });
            } else {
                tool.alertWarning("请勾选要操作的学生!");
            }
        },
        cx: function () {
            $(".yc").toggle();
            $(".butyc").toggle();
            $(".butzk").toggle();
        },
        sreach: function (el) {
            tool.doSearch(el);
            if ($("#ndFlag").val() != $("#nd").val()) {
                $("[onClick*='tool.doR'],[onClick*='tool.edi']").remove();
            } else {
                $("#czBtn").html(page.text);
            }

        },
        xsxxTb: function (el) {
            var form_element = $(el).parents('.form-horizontal');
            var ids = tool.getChoseData(form_element);
            if (!isBlank(ids)) {
                var url = 'https://www.scxszz.com:443/pros_sczz/s/biz/gxXsxx/xsxxTb';
                $.post(tool.initParams(url), {"wid": ids}, function (data) {
                    var d = eval('(' + data + ')');
                    if (d.oper_res) {
                        tool.alertSuccess(d.oper_msg);
                    } else {
                        tool.alertWarning(d.oper_msg);
                    }
                });
            } else {
                tool.alertWarning('请勾选要操作的数据!', '请在下方列表中至少勾选一条要操作的数据');
            }
        },
        importMb: function (el) {

        }
    };


    function editDatayx(el) {
        var form_element = $(el).parents('.form-horizontal');
        var ids = tool.getChoseData(form_element);
        if (!isBlank(ids)) {
            if (ids.split(",").length > 0) {
                tool.openModal({'remote': 'https://www.scxszz.com:443/pros_sczz/s/biz/gxXsxx/xsyxqy/' + ids})
            } else {
                tool.alertWarning('请选择要调整院系的学生!', '请在下方列表中至少勾选一条要调整院系的学生');
            }
        } else {
            tool.alertWarning('请选择要调整院系的学生!', '请在下方列表中至少勾选一条要调整院系的学生');
        }
    }

    function yxjs(el, type) {
        var form_element = $(el).parents('.form-horizontal');
        var ids = tool.getChoseData(form_element);
        if (!isBlank(ids)) {
            if (ids.split(",").length > 0) {
                var url = "https://www.scxszz.com:443/pros_sczz/s/biz/gxXsxx/yxjssave";
                $.ajax({
                    url: tool.initParams(url),
                    type: "post",
                    data: {"wid": ids, "type": type},
                    dataType: "json",
                    timeout: 1000 * 10,
                    success: function (data) {
                        if (data.oper_res) {
                            tool.alertSuccess(data.oper_msg);
                        }
                    }
                });
            } else {
                tool.alertWarning('请选择要操作的数据!', '请在下方列表中至少勾选一条要操作的数据');
            }
        } else {
            tool.alertWarning('请选择要操作的数据!', '请在下方列表中至少勾选一条要操作的数据');
        }
    }

    $(function () {

        tool.initFileUpload("#upload", null, null, true, "*.xls;*.xlsx;*.pdf;", "", null, function (file, data, response) {
            data = data.replace("\\", "");
            data = data.replace("\\", "/");
            data = eval("(" + data + ")");
            $("#_name").val(data.fileold);
            $("#_font a").html(data.fileold);
            $("#_path").val(data.filePath);
        }, null, null, '_queue');
    });

    function drqgmb() {
        var flag = $("#_path").val();
        if (flag != null && flag != "") {
            var hz = flag.substring(flag.lastIndexOf(".") + 1);
            if (hz == 'xls' || hz == 'xlsx') {
                $.post(tool.initParams('https://www.scxszz.com:443/pros_sczz/s/biz/gxXsxx/saveDepartid'), {'path': flag}, function (data) {
                    if (data.oper_res == true) {
                        tool.alertSuccess(data.oper_msg);
                    } else {
                        tool.alertWarning(data.oper_msg);
                    }
                });
            } else {
                tool.alertWarning('警告', '不是excel文件！！！');
            }
        }

    }
</script>
